﻿using System;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Configuration;

namespace SharePointSearchBench.Tests
{
    public class TestSettings
    {
        private TestSettings() { }

        public static string ServiceUrl
        {
            get
            {
                return ConfigurationManager.AppSettings["serviceUrl"];
            }
        }

        public static string ServiceUsername
        {
            get
            {
                return ConfigurationManager.AppSettings["serviceUsername"];
            }
        }
        public static string ServiceDomain
        {
            get
            {
                return ConfigurationManager.AppSettings["serviceDomain"];
            }
        }
        public static string ServicePassword
        {
            get
            {
                return ConfigurationManager.AppSettings["servicePassword"];
            }
        }

        public static string BaseKeywordQueryText
        {
            get
            {
                return ConfigurationManager.AppSettings["baseKeywordQueryText"];
            }
        }

        public static string BaseFullTextQueryText
        {
            get
            {
                return ConfigurationManager.AppSettings["baseFullTextQueryText"];
            }
        }

        public static string LargeResultsKeywordQueryText
        {
            get
            {
                return ConfigurationManager.AppSettings["largeResultsKeywordQueryText"];
            }
        }

        public static StringCollection BaseDisplayFields
        {
            get
            {
                string values = ConfigurationManager.AppSettings["baseDisplayFields"];
                string[] splitValues = values.Split(',');
                StringCollection items = new StringCollection();
                foreach (string value in splitValues)
                {
                    items.Add(value.Trim());
                }
                return items;
            }
        }
    }
}
